#include <iostream>

using namespace std;

#define MAX_NUMBER_OF_CARDS     100000
#define MAX_NUMBER_OF_PLAYERS   100

#define INVALID_CARD_IDX        MAX_NUMBER_OF_CARDS+1
#define INVALID_PLAYER          MAX_NUMBER_OF_PLAYERS+1

struct CARD_STACK_NODE
{
    unsigned int owner;
    unsigned int next_card_idx;
};

struct CARD_STACK
{
    unsigned int head_idx;
    unsigned int trail_idx;
    CARD_STACK_NODE card_stack_nodes[MAX_NUMBER_OF_CARDS];
};

CARD_STACK g_card_stack;

void init_card_stack(CARD_STACK& card_stack, unsigned int K)
{
    card_stack.head_idx = 0;
    card_stack.trail_idx = K-1;

    for(unsigned int i = card_stack.head_idx; i < card_stack.trail_idx; i++)
    {
        card_stack.card_stack_nodes[i].owner = INVALID_PLAYER;
        card_stack.card_stack_nodes[i].next_card_idx = i+1;
    }

    card_stack.card_stack_nodes[card_stack.trail_idx].owner = INVALID_PLAYER;
    card_stack.card_stack_nodes[card_stack.trail_idx].next_card_idx = card_stack.head_idx;
}

void deal_card(CARD_STACK& card_stack, unsigned int P, unsigned int owner)
{
    unsigned int top_idx, btm_idx;

    card_stack.card_stack_nodes[card_stack.head_idx].owner = owner;
    top_idx = btm_idx = card_stack.card_stack_nodes[card_stack.head_idx].next_card_idx;
    card_stack.card_stack_nodes[card_stack.trail_idx].next_card_idx = top_idx;

    while(--P != 0)
    {
        btm_idx = card_stack.card_stack_nodes[btm_idx].next_card_idx;
    }

    card_stack.head_idx = card_stack.card_stack_nodes[btm_idx].next_card_idx;
    card_stack.trail_idx = btm_idx;
}

int main(void)
{
    unsigned int N, K, P, M;

    while(cin>>N>>K>>P && !cin.eof())
    {
        M = K/N;

        init_card_stack(g_card_stack, K);

        for(unsigned int i = 0; i < K; i++)
        {
            deal_card(g_card_stack, P, i%N);
        }

        for(unsigned int i = 0; i < K; i++)
        {
            if (g_card_stack.card_stack_nodes[i].owner == (N-1))
                cout<<(i+1)<<endl;
        }
    }

    return 0;
}

